
package com.ie.cloud.payment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ie.cloud.payment.entity.RefundOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 退款订单表 Mapper 接口
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2021-04-27
 */
@Mapper
public interface RefundOrderMapper extends BaseMapper<RefundOrder> {

    /** 查询全部退成功金额 **/
    @Select("select ifnull(sum(refund_amount), 0) from t_refund_order where pay_order_id = #{payOrderId} and state = 2")
    Long sumSuccessRefundAmount(@Param("payOrderId") String payOrderId);

}
